package com.vitae.controller;

import com.alibaba.fastjson.JSONObject;
import com.vitae.entity.User;
import com.vitae.service._BaseService;
import com.vitae.service.userService.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


/**
 * Created by ouyu on 2018/5/15.
 */
@Controller
public class UserController  {
    @Autowired
    UserService userService;
    @GetMapping("toLogin")
    public String login(ModelMap modelMap){
        modelMap.put("Title","登陆");
        List<User> users = userService.findAll();
        String domain="";
        if(users!=null){
            domain=JSONObject.toJSONString(users);
        }
        modelMap.put("domain", domain);
        return "login/login";
    }


}
